<%@ page import="com.jkt.rms.commons.includes.*"%>
<%@ page import="java.util.*"%>
<%@ page import="com.jkt.rms.business.*"%>

<%@ include file="/WEB-INF/jsp/include.jsp" %>

<%@ page import="org.acegisecurity.ui.AbstractProcessingFilter"%>
<%@ page import="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter"%>
<%@ page import="org.acegisecurity.AuthenticationException"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="spring" uri="/spring"%>

<html>
<head>
<title><fmt:message key="lbl.title.loginPage" /></title>
</head>
 <body><center>
 	<c:if test="${not empty param.login_error}">
		<font color="red">
        Your login attempt was not successful, try again.<BR>
        Reason: <%= ((AuthenticationException) session.getAttribute(AbstractProcessingFilter.ACEGI_SECURITY_LAST_EXCEPTION_KEY)).getMessage() %>
      </font>
	</c:if> 
	<h2 id="headerbar"><fmt:message key="lbl.title.loginPage" /></h2>
	<div id="content">
		<div id="loginbox">
			<form action="<c:url value='j_acegi_security_check'/>" method="POST">
		  	<div>
		    	<label>User Name:</label>
		    	<!-- 
		    	<c:if test="${not empty param.login_error}">
		    	<input type='text' name='j_username' 
		    	value="<c:out value="${ACEGI_SECURITY_LAST_USERNAME}"/>" />
		    	</c:if>
		    	 -->
		    	<c:choose>
		    	<c:when test="${not empty param.login_error}">
		    	<input type='text' name='j_username' 
		    	value="<c:out value="${ACEGI_SECURITY_LAST_USERNAME}"/>" />
		    	</c:when>
		    	<c:otherwise>
		    	<input type='text' name='j_username' />
		    	</c:otherwise>
		    	</c:choose>
		    	<br>		    	
		    	<label>Password:</label><input name="j_password"  maxlength="20" type="password" size="23" style="width:162px"><br>
				<br>				
				<input type="submit" class="button" name="Submit" value="Login"  id="loginbutton" ><br>
			 		<% Map model =  (Map)request.getAttribute("model");				
			 			if(model != null &&  model.get("Error")!=null){
			 		%>
			 	<input type="checkbox" name="_acegi_security_remember_me">Don't ask for my password for two weeks
				<span class="error"><b> <%=model.get("Error")%></b></span>
			 	<%}%>
				<br><br>
				<a href="forgotpassword.htm">Forgot Password?</a>
		 	</div>
			</form>
		</div>
		<p>&nbsp;</p>			
		<p>Welcome to RMS!!</p>
		<p>
		A one-stop source to manage the projects/vendor/resources information for MRIPRJ.
		</p>
		<p>
		Designed to consolidate and centralize general information and
		services, the portal gives access to MRIPRJ Admin/Account Members regarding onsite/offshore info of resources and projects for the MRIPRJ.
		</p>
		<p>
		An initiative to build Resource Management System is an essential asset to manage the projects/vendor and resources in better manner.
		</p>
		<p>
		Happy Browsing!!
		</p>
		<br>			
	</div>
		
<%@ include file="footer.jsp" %>
</center></body>
</html>
